using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace BlogSystem.Data.Entity;

/// <summary>
/// 实体基类  共有属性
/// </summary>
public class BaseEntity
{

    public BaseEntity()
    { 
       CreateTime = DateTime.UtcNow;
    }
    
    /// <summary>
    /// 编号id
    /// </summary>
    [Key]
    [Column("id")]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 
    public int Id { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    [Column("status")]
    public int? Status { get; set; } = 1;
    
    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("create_time")]
    public DateTime? CreateTime { get; set; }
    
    /// <summary>
    /// 更新时间  [Timestamp]
    /// </summary>
    [Column("update_time")]
    public DateTime? UpdateTime { get; set; }
    
    

}